<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<script type="text/javascript">
    $(function() {
    	$("#currParentid").val(parent.getParentId());
        $('#dictEditForm').form({
            url : '${path }/dict/save',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                 	parent.$.messager.show({title: '提示！',msg:result.msg});
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    var form = $('#dictEditForm');
                    parent.$.messager.alert('提示', eval(result.msg), 'warning');
                }
            }
        });
        
    });
</script>
<div class="easyui-layout" data-options="fit:true,border:false">
    <div  data-options="region:'center',border:false" title="" style="padding: 3px;">
        <form id="dictEditForm" method="post">
        	<input type="hidden" name="id"  value="${dict.id}"/>
			<input type="hidden"  name="parentid" id="currParentid" value="${dict.parentid}" />
			<input type="hidden" name="oldId" id="oldId" value="${dict.id}"/>
			<input type="hidden" name="oldCode" id="oldCode" value="${dict.dictcode}"/>
            <table class="grid">
                <tr>
                    <td>字典编码：</td>
                    <td><input name="dictcode" type="text" placeholder="请输入字典编码" class="easyui-validatebox" data-options="required:true" value="${dict.dictcode}"></td>
                    <td>字典名称:</td>
                    <td><input name="dictname" type="text" placeholder="请输入名称" class="easyui-validatebox" data-options="required:true" value="${dict.dictname}"></td>
                </tr>
                <tr>
                    <td>显示序号：</td>
                    <td><input type="text" name="sequence" value="${dict.sequence}" class="easyui-numberbox"/></td>
                    <td>有效标志：</td>
                    <td>
		              <input type="radio" name="status" id="status1" <c:choose> <c:when test="${dict.status== '1'}"> checked="checked" </c:when></c:choose>  value="1"style="bottom: 0px; height: 16px" />
					  <label for="status1">
						有效
					 </label>
					 <input type="radio" name="status" id="status0" value="0" <c:choose> <c:when test="${dict.status== '0'}"> checked="checked" </c:when></c:choose>   
						style="bottom: 0px; height: 16px" />
					<label for="status0">
						无效
					</label>
		          </td>
                </tr>
                <tr>
                	<td>备注信息：</td>
                    <td colspan="3">
                        <textarea rows="3" cols="3" name="remark" style="width: 100%;">${dict.remark}</textarea>
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>